<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article# " lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Tj2's Blog">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>绿萝间 (old posts, page 4) | 绿萝间</title>
<link href="assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
<link href="assets/css/ipython.min.css" rel="stylesheet" type="text/css">
<link href="assets/css/nikola_ipython.css" rel="stylesheet" type="text/css">
<meta name="theme-color" content="#5670d4">
<meta name="generator" content="Nikola (getnikola.com)">
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
<link rel="canonical" href="https://muxuezi.github.io/index-4.html">
<link rel="prev" href="index-5.html" type="text/html">
<link rel="next" href="index-3.html" type="text/html">
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"] ],
        displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
        processEscapes: true
    },
    displayAlign: 'center', // Change this to 'center' to center equations.
    "HTML-CSS": {
        styles: {'.MathJax_Display': {"margin": 0}}
    }
});
</script><!--[if lt IE 9]><script src="assets/js/html5.js"></script><![endif]-->
</head>
<body>
<a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>

<!-- Menubar -->

<nav class="navbar navbar-inverse navbar-static-top"><div class="container">
<!-- This keeps the margins nice -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-navbar" aria-controls="bs-navbar" aria-expanded="false">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="https://muxuezi.github.io/">

                <span id="blog-title">绿萝间</span>
            </a>
        </div>
<!-- /.navbar-header -->
        <div class="collapse navbar-collapse" id="bs-navbar" aria-expanded="false">
            <ul class="nav navbar-nav">
<li>
<a href="archive.html">Archive</a>
                </li>
<li>
<a href="categories/">Tags</a>
                </li>
<li>
<a href="rss.xml">RSS feed</a>

                
            </li>
</ul>
<ul class="nav navbar-nav navbar-right"></ul>
</div>
<!-- /.navbar-collapse -->
    </div>
<!-- /.container -->
</nav><!-- End of Menubar --><div class="container" id="content" role="main">
    <div class="body-content">
        <!--Body content-->
        <div class="row">
            
            

    
<div class="postindex">
    <article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/matplotlib-gbk.html" class="u-url">matplotlib-gbk</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/matplotlib-gbk.html" rel="bookmark"><time class="published dt-published" datetime="2010-01-01T13:44:27+08:00" title="2010-01-01 13:44">2010-01-01 13:44</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p></p>
<p>将中文字体文件复制到：
%PythonPath%Libsite-packagesmatplotlibmpl-datafontsttf</p>
<p>下，这里以上一节介绍的Yahei Mono字体为例。</p>
<p>找到Matplotlib的配置文件matplotlibrc，全局配置文件的路径：</p>
<p>%PythonPath%Libsite-packagesmatplotlibmpl-datamatplotlibrc</p>
<p>用户配置文件路径：</p>
<p>c:Documents and Settings%UserName%.matplotlibmatplotlibrc</p>
<p>用文本编辑器打开此文件，进行如下编辑：</p>
<p>找到设置font.family的行，改为font.family : monospace，注意去掉前面的#号。</p>
<p>在下面添加一行：font.monospace : Yahei Mono。</p>
<p>在matplotlib中使用中文字符串时记住要用unicode格式，例如：u"测试中文显示"。</p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/mint-15-upto-16.html" class="u-url">mint-15-upto-16</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/mint-15-upto-16.html" rel="bookmark"><time class="published dt-published" datetime="2010-01-01T13:44:27+08:00" title="2010-01-01 13:44">2010-01-01 13:44</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p></p>
<p>sudo sed -i 's/raring/saucy/' /etc/apt/sources.list
sudo sed -i 's/olivia/petra/' /etc/apt/sources.list</p>
<p>sudo sed -i 's/raring/saucy/' /etc/apt/sources.list.d/official-package-repositories.list</p>
<p>sudo sed -i 's/olivia/petra/' /etc/apt/sources.list.d/official-package-repositories.list</p>
<p>sudo apt-get update &amp;&amp; sudo apt-get dist-upgrade</p>
<p>sudo apt-get upgrade</p>
<p>%%timeit about 2 hours</p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/mint-printer.html" class="u-url">mint-printer</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/mint-printer.html" rel="bookmark"><time class="published dt-published" datetime="2010-01-01T13:44:27+08:00" title="2010-01-01 13:44">2010-01-01 13:44</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p></p>
<p>Alt + F2
<code>system-config-printer</code></p>
<p>即可</p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/n-forms-trans.html" class="u-url">n-forms-trans</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/n-forms-trans.html" rel="bookmark"><time class="published dt-published" datetime="2010-01-01T13:44:27+08:00" title="2010-01-01 13:44">2010-01-01 13:44</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p></p>
<p>option都适用</p>
<p class="more"><a href="posts/n-forms-trans.html">Read more…</a></p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/network-scripting.html" class="u-url">network-scripting</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/network-scripting.html" rel="bookmark"><time class="published dt-published" datetime="2010-01-01T13:44:27+08:00" title="2010-01-01 13:44">2010-01-01 13:44</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<!--
.. title: Python Network Scripting
.. slug: network-scripting
.. date: 05/30/2014 12:30:55 AM UTC
.. tags: Python
.. link:
.. description:
.. type: text
-->

<p>Include socket, protocol, fork, thread, SocketServer, select, Twisted.</p>
<p>This is <a href="http://nbviewer.ipython.org/github/muxuezi/pp4p/blob/master/pyNetworkScripting.ipynb" title="Python Network Scripting">Python Network Scripting</a> reference link.</p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/office2010a-ey.html" class="u-url">office2010a-ey</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/office2010a-ey.html" rel="bookmark"><time class="published dt-published" datetime="2010-01-01T13:44:27+08:00" title="2010-01-01 13:44">2010-01-01 13:44</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p></p>
<p>6QFDX-PYH2G-PPYFD-C7RJM-BBKQ8</p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/outer-vga-debian.html" class="u-url">outer-vga-debian</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/outer-vga-debian.html" rel="bookmark"><time class="published dt-published" datetime="2010-01-01T13:44:27+08:00" title="2010-01-01 13:44">2010-01-01 13:44</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p></p>
<p>xrandr --output VGA --auto --output LVDS --off</p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/pandas.html" class="u-url">pandas</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/pandas.html" rel="bookmark"><time class="published dt-published" datetime="2010-01-01T13:44:27+08:00" title="2010-01-01 13:44">2010-01-01 13:44</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p></p>
<p>pandas细节比较多，<a title="pandas" href="http://pandas.pydata.org/index.html" target="_blank">更新也快</a>，绝对可以替代所有sql
</p>
<h2>0.13中ExcelWriter支持使用with写入多sheet，更人性化</h2>
<p>with ExcelWriter('path_to_file.xlsx') as writer:</p>
<p>df1.to_excel(writer, sheet_name='Sheet1')</p>
<p>df2.to_excel(writer, sheet_name='Sheet2')</p>
<h3>0.12中，需要用writer.save()保持才能输出</h3>

<h3>0.13ExcelWriter支持Excel writer engines</h3>

<p>XlsxWriter —— .xlsx</p>
<p>openpyxl —— .xlsm files</p>
<p>xlwt —— .xls files</p>
<h2>通过map实现多条件筛选</h2>

<p>criterion = rdctemp[u'省名称'].map(lambda x: x.startswith(prov.decode('utf8')[:2]))</p>
<p>rdctemp.loc[criterion,dstname] = price</p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/pandas-table-items.html" class="u-url">pandas-table-items</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/pandas-table-items.html" rel="bookmark"><time class="published dt-published" datetime="2010-01-01T13:44:27+08:00" title="2010-01-01 13:44">2010-01-01 13:44</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p></p>
<div class="dp-highlighter">
<div class="bar">通过bookall.groupby(obj)获取所有group</div>
<div class="bar">然后对每个group的属性进行合并bookunit.<span class="builtins" style="color: #ff1493;">append</span>('&amp;&amp;'.join([<span class="builtins" style="color: #ff1493;">str</span>(x) <span class="keyword" style="font-weight: bold; color: blue;">for</span> x <span class="keyword" style="font-weight: bold; color: blue;">in</span> bookall.ix[v, i].<span class="builtins" style="color: #ff1493;">values</span>]))</div>

<p class="more"><a href="posts/pandas-table-items.html">Read more…</a></p>
</div>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/parallel-system-tools.html" class="u-url">parallel-system-tools</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/parallel-system-tools.html" rel="bookmark"><time class="published dt-published" datetime="2010-01-01T13:44:27+08:00" title="2010-01-01 13:44">2010-01-01 13:44</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<!--
.. title: Parallel System Tools
.. slug: parallel-system-tools
.. date: 05/28/2014 02:39:05 AM UTC
.. tags: Python
.. link:
.. description:
.. type: text
-->

<p>Include fork, pipes, socket, thread, signal, multiprocess</p>
<p>This is <a href="http://nbviewer.ipython.org/github/muxuezi/pp4p/blob/master/pyprogress.ipynb" title="Parallel System Tools">Parallel System Tools</a> reference link.</p>
</div>
    </div>
    </article>
</div>

        <nav class="postindexpager"><ul class="pager">
<li class="previous">
                <a href="index-5.html" rel="prev">Newer posts</a>
            </li>
            <li class="next">
                <a href="index-3.html" rel="next">Older posts</a>
            </li>
        </ul></nav>
</div>
        <!--End of body content-->

        <footer id="footer">
            Contents © 2017         <a href="mailto:muxuezi@gmail.com">Tao Junjie</a> - Powered by         <a href="https://getnikola.com" rel="nofollow">Nikola</a>         
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0">
<img alt="Creative Commons License BY-NC-SA" style="border-width:0; margin-bottom:12px;" src="http://i.creativecommons.org/l/by-nc-sa/4.0/80x15.png"></a>
            
        </footer>
</div>
</div>


            <script src="assets/js/all-nocdn.js"></script><script>$('a.image-reference:not(.islink) img:not(.islink)').parent().colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script><!-- fancy dates --><script>
    moment.locale("en");
    fancydates(0, "YYYY-MM-DD HH:mm");
    </script><!-- end fancy dates --><script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-51330059-1', 'auto');
  ga('send', 'pageview');

</script>
</body>
</html>
